<!DOCTYPE HTML>
<html lang="en">
<head>
    <link rel="stylesheet" href="__PUBLIC__/phone/css/styles.css" />
    <meta charset='UTF-8' />
    <meta name='generator' content='ecos.b2c' />
    <title>会员中心_三鑫-灯世界网销平台</title>
    <meta name='keywords' content='会员中心__三鑫-灯世界网销平台' />
    <meta name='description' content='会员中心__三鑫-灯世界网销平台' />
    <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'/>
    <link href="__PUBLIC__/phone/css/zhuce_style.css" rel="stylesheet" media="screen, projection" />
    <script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<!--公共搜索栏-->
<include file="./phone/Home/View/Public/search.html"/>

    <div class="full-screen">
        <header>
            <div class="a-bar">
                <a href="javascript:history.back()" class="a-back">
                    <i class="arr left"></i>
                    返回
                </a>
                <div class="a-name">
                    添加收货地址
                </div>
            </div>
        </header>
        <div class="address-form">

        <form action="{:U('add_address')}" class="form" method="post" data-type="ajax">
            <input type="hidden" name="cid" value="{$cid}">
            <input type="hidden" name="add" value="{$add}">
            <div class="c-g" style=" height: auto !important;min-height: 32px;">
                <label class="c-l">地区</label>
                <div class="c">
                    <span class="region" vtype="">
                        <select name="province" id="province" required style="width: 23%">
                            <option value="">请选择</option>
                            <volist name="province" id="pr">
                                <option value="{$pr.code}">{$pr.name}</option>
                            </volist>
                        </select>
                        <select name="city" id="city" required style="width: 23%"></select>
                        <select name="county" id="county" required style="width: 23%"></select>
                        <select name="town" id="town" required style="width: 23%"></select>
                    </span>
                </div>
            </div>
            <div class="c-gadss" style="padding: 10px 0;">
                <label class="c-l">收货地址</label>
                <div class="c">
                    <input type="text" class="text" name="addr" required="required" data-caution="收获地址不能为空" />
                </div>
            </div>
            <div class="c-gadss" style="padding: 10px 0;">
                <label class="c-l">邮编</label>
                <div class="c">
                    <input type="text" class="text" name="postcode" value="" />
                </div>
            </div>
            <div class="c-gadss" style="padding: 10px 0;">
                <label class="c-l">收货人</label>
                <div class="c">
                    <input type="text" class="text" name="receiver" value="" required="required" data-caution="收货人姓名不能为空" />
                </div>
            </div>
            <div class="c-gadss" style="padding: 10px 0;">
                <label class="c-l">手机</label>
                <div class="c">
                    <input type="text" class="text" name="phone" value="" required="required" vtype="mobile" data-caution="手机不能为空" />
                </div>
            </div>
            <div class="c-g-c">
            	<label for="def_addr_check">设为默认收货地址</label>
                <input type="checkbox" name="status" value="1" id="def_addr_check" style="background: #fff;"/>
                <div style="clear: both;"></div>
            </div>
            <div class="btn-bar" style="width: 60%;margin: 20px auto;">
                <button type="submit" class="btn" rel="_request" style="border-radius: 15px;background: #00a1f2;;">保存地址</button>
            </div>
        </form>
    </div>
    </div>

    <div class="full-screen">
        <!--公共底部-->
        <include file="./phone/Home/View/Public/foot.html"/>
    </div>

    <div style="text-align: center;"><a target="_blank" href="http://www.miitbeian.gov.cn/">冀ICP备10201034号-2 </a></div>

<!--地址四级联动-->
<script>
    $('#province').change(function () {
        var province = $('#province').val();
        $.ajax({
            url:"{:U('area')}",
            type:'post',
            data:{'pid':province},
            success:function (e) {
                var data = JSON.parse(e);
                var area = '<option>请选择</option>';
                for(var i=0;i<data.length;i++){
                    area +='<option value="'+data[i].code+'">'+data[i].name+'</option>';
                }
                $('#city').html(area);
            }
        })
    })
    $('#city').change(function () {
        var city = $('#city').val();
        $.ajax({
            url:"{:U('area')}",
            type:'post',
            data:{'pid':city},
            success:function (e) {
                var data = JSON.parse(e);
                var area = '<option>请选择</option>';
                for(var i=0;i<data.length;i++){
                    area +='<option value="'+data[i].code+'">'+data[i].name+'</option>';
                }
                $('#county').html(area);
            }
        })
    })
    $('#county').change(function () {
        var county = $('#county').val();
        $.ajax({
            url:"{:U('area')}",
            type:'post',
            data:{'pid':county},
            success:function (e) {
                var data = JSON.parse(e);
                var area = '<option>请选择</option>';
                for(var i=0;i<data.length;i++){
                    area +='<option value="'+data[i].code+'">'+data[i].name+'</option>';
                }
                $('#town').html(area);
            }
        })
    })
</script>
</body>
</html>
